<template>
  <div v-loading="$store.state.pageLoading" class="app-container dashboard-editor-container" element-loading-text="数据加载中...">
    <div class="chart-wrapper" style="margin-bottom:32px;">
      <bar-chart v-if="$store.state.showPopTablistChart" :chart-data="$store.state.popTablistChart" />
    </div>
    <el-table :data="$store.state.popTablist.list" border fit highlight-current-row>
      <el-table-column label="职业" align="center">
        <template slot-scope="scope">
          {{ scope.row.job }}
        </template>
      </el-table-column>
      <el-table-column label="人数" align="center">
        <template slot-scope="scope">
          <span>{{ scope.row.num || 0 }}</span>
        </template>
      </el-table-column>
    </el-table>
  </div>
</template>

<script>
import { getPopTablist } from "@/api/personnel";
import BarChart from "../../components/BarChart";

export default {
  components: { BarChart },
  created() {
    getPopTablist("Occupation");
  }
};
</script>
